//
//  ViewController.m
//  xmdwifi
//
//  Created by hao on 16/3/20.
//  Copyright © 2016年 hao. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
{
    NSString *url2;
}

@property (weak, nonatomic) IBOutlet UIImageView *MyImageview;

@property (weak, nonatomic) IBOutlet UITextField *urllabel;

@property (weak, nonatomic) IBOutlet UIButton *loadingimage;



@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)loadingclick:(UIButton *)sender {
    [self.view viewWithTag:1000];
    url2 = _urllabel.text;
    if(url2 == nil) {
        NSLog(@"路径不能为空!");
    }else {
        NSData *imagedata1 = [NSData dataWithContentsOfFile:url2];
        UIImage *image1 = [UIImage imageWithData:imagedata1];
    self.MyImageview.image = image1;
    }
}

- (UIImage*)loadingiamgefromurl:(NSString *)fileurl{
    NSLog(@"test");
    NSLog(@"jdjdjdjdjdjdjjdjdjdjdjdjdjjdj");
    UIImage *result;
    NSData *imagedata = [NSData dataWithContentsOfURL:[NSURL URLWithString:fileurl]];
    result = [UIImage imageWithData:imagedata];
    return result;
}

@end
